package com.caigou.modules.vote.adpter

import android.widget.CheckBox
import com.caigou.modules.vote.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @author #Suyghur.
 * Created on 2021/12/30
 */
class PeriodItemAdapter(dataset: MutableList<String>) :
    BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_vote_period_list, dataset) {

    val checkBoxes = mutableListOf<CheckBox>()

    override fun convert(holder: BaseViewHolder, item: String) {
        with(holder.getView<CheckBox>(R.id.item_hk_period_cb)) {
            text = item
            if (getItemPosition(item) == 0) {
                isChecked = true
            }
            checkBoxes.add(this)
        }
    }
}